[HVM] Add broadcast destination for physical destination mode in
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 13 Sep 2006 13:12:28 +0000 (14:12 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 13 Sep 2006 13:12:28 +0000 (14:12 +0100)
VLAPIC.
Based on a patch from Xiaohui Xin <xiaohui.xin@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/hvm/vioapic.c

index 8e3b9f95939495cd250598bbafe90e7fffae924a..2999bfe4f1f078329bf4b03ea4a2dbd563f01b98 100644 (file)
@@ -362,21 +362,35 @@ static uint32_t ioapic_get_delivery_bitmask(hvm_vioapic_t *s,
 
     ASSERT(s);
 
-    if (dest_mode == 0) { /* Physical mode */
-        for (i = 0; i < s->lapic_count; i++) {
-            if (VLAPIC_ID(s->lapic_info[i]) == dest) {
+    if ( dest_mode == 0 )
+    {
+        /* Physical mode. */
+        for ( i = 0; i < s->lapic_count; i++ )
+        {
+            if ( VLAPIC_ID(s->lapic_info[i]) == dest )
+            {
                 mask = 1 << i;
                 break;
             }
         }
-    } else {
-        /* logical destination. call match_logical_addr for each APIC. */
-        if (dest != 0) {
-            for (i=0; i< s->lapic_count; i++) {
+
+        /* Broadcast. */
+        if ( dest == 0xFF )
+        {
+            for ( i = 0; i < s->lapic_count; i++ )
+                mask |= ( 1 << i );
+        }
+    }
+    else
+    {
+        /* Logical destination. Call match_logical_addr for each APIC. */
+        if ( dest != 0 )
+        {
+            for ( i = 0; i < s->lapic_count; i++ )
+            {
                 if ( s->lapic_info[i] &&
-                     ioapic_match_logical_addr(s, i, dest) ) {
+                     ioapic_match_logical_addr(s, i, dest) )
                     mask |= (1<<i);
-                }
             }
         }
     }